Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Temporary) caching cdn handler until we sort out bundling #4

Closed

Conversation

maartenbreddels
Copy link
Member

(replaces #3)

Issue to solve

For loading js modules, we have to choose a system, either the notebook extension method or the jupyter lab bundling. This new loader (frontend) will be a temporary solution that will 'just work' until we find the proper way to do this. It will try to fetch from <server>/voila/require/module@semver, which at the server will

  • try to find the cached version and return that
  • if not found will fetch it from a CDN (default is unpkg) and write it to cache

But only for modules in a whitelist (security concern)

Issues:

It will not respect semver, so will never fetch a patched version once it cached a version.

Where cache?

It first tries {prefix}/share/jupyter/voila_cache/{module}/{semver}, and on failure will use the user directory.

@SylvainCorlay
Copy link
Member

We may also want to support the use case where all the widgets are in a single bundle like with jupyterlab.

The loading of external bundles could be activated as an opt-in.

There are benefits to both use cases (all in one bundle, and bundles loaded separately). @jasongrout may have an opinion on that.

@jasongrout
Copy link
Member

I think it makes a lot of sense to support the local widgets only use case.

@SylvainCorlay
Copy link
Member

We started having some in-depth discussions with @maartenbreddels about having a jupyterlab remix as a front-end for this, reusing the jupyterlab extension mechanism etc.

Would love to brainstorm with you about this.

@jasongrout
Copy link
Member

Sounds great. Let's talk today or tomorrow.

@astrojuanlu
Copy link
Contributor

Would this help in making the load times a bit faster?

@maartenbreddels
Copy link
Member Author

Yes it would, what you can also do is put e.g. bqplot.js in the voila/static directory for now (If you open the browser dev console you should see it first tries to fetch that file before trying the cdn

@trungleduc
Copy link
Member

Closed due to inactivity

@trungleduc trungleduc closed this Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants